/*
 * pdataextp.c
 *
 *  Created on: May 11, 2010
 *      Author: zhjilin
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
main(int argc, char *argv[])
  {FILE *fp;
   char temp[15],command[50],fn[15];
   int i;
   for(i=0;i<15;i++)
	   fn[i]='\0';
   for(i=0;i<50;i++)
	   command[i]='\0';
   fp=fopen(argv[1],"r");
   if(fp==NULL)
	   {
       printf("Please input a list file U need make data extract");
       return 1;
	   }
   strncpy(command,"./dataextp ",11);
   while(!feof(fp))
        {
          fgets(temp,15,fp);
          strncpy(fn,temp,4);
          strcat(fn,".ruf.ent");
          strcat(command,fn);
          printf("waiting command……… %s \n",command);
          system(command);
          for(i=0;i<50;i++)
        	  command[i]='\0';
          for(i=0;i<15;i++)
        	  fn[i]='\0';
          strncpy(command,"./dataextp ",11);
         }

  }
